package com.hn.zhijian.base.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.Data;
import java.util.Date;

/**
 * @author carl chen
 * @Classname BaseEntity
 * @Description 父类
 * @Date 2019/10/29 18:36
 */
@Data
public class BaseEntity<T extends Model<?>> extends Model<T> {
    @TableId(value="id")
    private Long id;
    /**
     * 创建时间
     */
    @TableField(value = "create_time",fill = FieldFill.INSERT)
    protected Date createTime;

    /**
     * 更新时间
     */
    @TableField(value = "update_time",fill = FieldFill.INSERT_UPDATE)
    protected Date updateTime;

    /**
     * 是否已删除 1=已删除 0=未删除
     */
    @TableField("is_deleted")
    private Integer isDeleted;


    public static final String ID = "id";

    public static final String CREATE_TIME = "create_time";

    public static final String IS_DELETED = "is_deleted";

    public static final String UPDATE_TIME = "update_time";

    public static final String DESCRIPTION = "description";

    public static final String IS_FIXED = "is_fixed";
}
